package com.youtills.core.random;

import java.io.IOException;
import java.util.Random;

/**
 * TODO
 *
 * @author Ravi Kumar Chiluveru
 * @since 1.0, (12/11/13 5:16 PM)
 */
public class RandomGenerator {

    public static byte[] generateRandomBytes(int count){
        Random random = new Random();
        byte[] bytes = new byte[count];
        random.nextBytes(bytes);
        return bytes;
    }

/*
    public static void main(String[] args){
        byte[] random = generateRandomBytes(8);
        for(int i = 0; i < random.length; i++){
            System.out.println(i + "-->" + random[i]);
        }
        String rs = new BASE64Encoder().encode(random);
        System.out.println(rs);
        try {
            byte[] after = new BASE64Decoder().decodeBuffer(rs);
            for(int i = 0; i < after.length; i++){
                System.out.println(i + "-->" + after[i]);
            }

        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }
*/
}
